<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/3/23 0023
 * Time: 16:30
 */

namespace app\api\controller;


use app\api\service\UserService;

class User extends Common
{
    public function _empty($name)
    {
        die('非法访问！你的IP已被监控！');
    }

    /**
     * @name 获取账户金币信息
     * @author zay
     * @Date 2020/3/23 0023 16:30
     */
    public function getcoin()
    {
        $appdata = $this->appdata;
        $userinfo = $this->userinfo;
        $data = [
            'id' => $userinfo['id'],
            'uname' => $userinfo['uname'],
            'idc' => $userinfo['idc'],
            'idc_freeze' => $userinfo['idc_freeze'],
            'idc_reset'=>bcsub($userinfo['idc'],$userinfo['idc_freeze'],2),
        ];
        apifasong(['zt' => 1, 'msg' => '', 'data' => $data]);
    }

    /**
     * @name 用户邀请信息
     * @author zay
     * @Date 2020/3/24 0024 10:16
     */

    public function invite()
    {
        $appdata = $this->appdata;
        $userinfo = $this->userinfo;
        return UserService::service()->invite($appdata, $userinfo);
    }

    // 重新获取用户信息
    public function regain_user()
    {
        $userinfo = $this->userinfo;
        apifasong(['zt' => 1, 'msg' => '操作成功', 'data' => apiuserbaseinfo($userinfo)]);
    }

    /**
     * @name 解析用户身份证信息
     * @author zay
     * @Date 2020/3/31 0031 17:39
     */

    public function renzheng()
    {
        $appdata = $this->appdata;
        $userinfo = $this->userinfo;
        return UserService::service()->renzheng($appdata, $userinfo);
    }

    /**
     * @name 人脸对比
     * @author zay
     * @Date 2020/3/31 0031 17:39
     */

    public function face_very()
    {
        $appdata = $this->appdata;
        $userinfo = $this->userinfo;
        return UserService::service()->face_very($appdata, $userinfo);
    }

    /**
     * @name 验证身份证号和真实姓名是否一致
     * @author zay
     * @Date 2020/3/31 0031 17:40
     */

    public function verify()
    {
        $code = '';
        $truename = '';
        return UserService::service()->verify($code, $truename);
    }

    /**
     * @name 绑定支付宝、微信
     * @author zay
     * @Date 2020/4/7 0007 09:59
     */

    public function bind()
    {
        $appdata = $this->appdata;
        $userinfo = $this->userinfo;
        return UserService::service()->bind($appdata, $userinfo);
    }

    /**
     * @name 获取用户支付方式
     * @author zay
     * @Date 2020/4/7 0007 09:59
     */

    public function getpay()
    {
        $appdata = $this->appdata;
        $userinfo = $this->userinfo;
        return UserService::service()->getpay($appdata, $userinfo);
    }

    /**
     * @name 赠送币列表
     * @author zay
     * @Date 2020/4/8 0008 11:10
     */

    public function sendcoin()
    {
        $appdata = $this->appdata;
        $userinfo = $this->userinfo;
        return UserService::service()->sendcoin($appdata, $userinfo);
    }

}